package org.timemachine.action.facade;

import java.util.List;

import org.timemachine.factory.spi.EntityChange;
import org.timemachine.model.base.ChangeInfo;

public interface EntityChangeFacade {

	public void createEntityChange(EntityChange entity) ;
	
	public EntityChange updateEntityChange(EntityChange entity);
	
	public EntityChange removeEntityChange(EntityChange entity);

	public Object findPreviousEntityChange(Object entityChange, ChangeInfo endChangeInfo);

	public Object findPreviousEntityChange(Object entityChange);
	
	public ChangeInfo getEndChangeInfo();

	public List<?> listAllByManyToOneEntity(String entityChangeName, String manyToOneEntityName, Integer manyToOneEntityId); 
	
	public List<EntityChange> listHistoricalData(Object entity, Object entityId, String manyToOneEntityName);
	
	public List<EntityChange> listForwardData(Object entity, Object entityId, String manyToOneEntityName);

	public EntityChange getEntityChange(Object entity);
	
	public void deleteForwardEntityChange(Integer changeId, Object entity);

}
